<template>
  <div class="person">
    <h2>姓名：{{ name }}</h2>
    <h2>年龄：{{ age }}</h2>
    <h2>座驾：{{ car }}</h2>
    <button @click="age += 1">点我年龄+1</button>
    <button @click="name += '~'">点我换名字</button>
    <button @click="car.price += 10">点我改车的价格</button>
    <button @click="car.brand = '雅迪'">点我改车的品牌</button>
    <button @click="car = {brand:'保时捷',price:9999}">点我改车</button>
  </div>
</template>

<script>
  export default {
    name:'Person',
    /* data() {
      return {
        name:'李四'
      }
    }, */
    props:['name','age','car'],
  }
</script>

<style scoped>
  .person {
    margin-top: 10px;
    margin-bottom: 10px;
    background-color: skyblue;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px;
  }
</style>